<template>
  <div class="profile-wallet">
    <h3>我的钱包</h3>
    <div class="profile-div">
      <van-grid>
        <van-grid-item
          v-for="(item, index) in uls"
          :key="index"
          :icon="item.icon"
          :text="item.text"
          @click="toDetails(item,index)"
        />
      </van-grid>
    </div>
  </div>
</template>

<script>
export default {
  name: "profileWallet",
  data() {
    return {
      defaultTitle: '', // 获取到的标题
      uls: [
        {
          icon: "gold-coin-o",
          text: "钱包",
          title: '我的钱包'
        },
        {
          icon: "star-o",
          text: "积分",
          title: '积分商城'
        },
        {
          icon: "point-gift-o",
          text: "优惠券",
          title: '优惠券'
        },
        {
          icon: 'idcard',
          text: "反馈",
          title: '反馈'
        }
      ]
    };
  },
  methods: {
    toDetails(text,index) {
      this.$router.push({
        path: 'walletdetail',
        query: {
          title: text.title,
          idx: index
        }
        // name: 'Walletdetail',
        // params: {
        //   title: e
        // },
        // hash: `${e}`
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.profile-wallet {
  width: 96%;
  height: $height * 2.8;
  background-color: #fff;
  margin: 0 auto;
  border-radius: 20px;
  margin-top: -10px;
  position: relative;
  h3 {
    font-size: 14px;
    color: #555;
    padding-left: 14px;
    padding-top: 10px;
    box-sizing: border-box;
  }
  .van-grid {
    margin: 10px;
    .van-grid-item {
      height: $height * 1.5;
      border: 1px solid #fff;
      box-shadow: none;
    }
  }
}
</style>